package com.example.photography.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.example.photography.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class TextAdapter extends MyBaseAdapter {
    public TextAdapter(List list, Context context) {
        super(list, context);
    }

    @Override
    public View myGetView(int position, View convertView) {
        ViewHolder holder = null;
        if (convertView == null) {
            convertView = View.inflate(mContext, R.layout.item_textview, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        String text = (String) list.get(position);
        holder.tvGroup.setText(text);
        return convertView;
    }

    static
    class ViewHolder {
        @BindView(R.id.tv_group)
        TextView tvGroup;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
